<?php
/*
|--------------------------------------------------------------------------
| Web Routes: Namespace WWW
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
use Illuminate\Contracts\Routing\Registrar as RouteRegisterContract;
Route::domain('www.'.env('APP_DOMAIN'))->namespace('Index')->group(function (RouteRegisterContract $route) {
    $route->middleware('normal')->group(function (RouteRegisterContract $route) {
        //  首页
        $route->get('/', 'IndexController@Index')->name('home');

        $route->group(['prefix' => '/user'], function (RouteRegisterContract $route) {
            //  登录页
            $route->get('/login', 'UserController@login')->name('user/login');
            //  注册页
            $route->get('/register', 'UserController@register')->name('user/register');
            //  找回密码页
            $route->get('/findPwd', 'UserController@findPwd')->name('user/findPwd');

            $route->any('/logout', 'UserController@logout')->name('user/logout');
        });

        $route->group(['prefix' => '/project'], function (RouteRegisterContract $route) {
            $route->get('/index', 'ProjectController@index')->name('www/project/index');
        });
    });

    $route->middleware('user.auth')->group(function (RouteRegisterContract $route) {
        $route->group(['prefix' => '/user'], function (RouteRegisterContract $route) {
            //  个人中心首页
            $route->get('/index', 'UserControoler@index')->name('user/index');
            //  个人资料
            $route->get('/profile', 'UserController@profile')->name('user/profile');
            //  修改密码页
            $route->get('/changePwd', 'UserController@changePwd')->name('user/changePwd');
            //  验证旧邮箱页
            $route->get('/oldEmailVerify', 'UserController@oldEmailVerify')->name('user/oldEmailVerify');
            //  验证新邮箱页
            $route->get('/newEmailVerify', 'UserController@newEmailVerify')->name('user/newEmailVerify');

            
        });
    });
});